package com.hn658.base.message.itf.impl;

import java.io.IOException;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.MonitorConfig;
import com.alibaba.dubbo.config.ReferenceConfig;
import com.hn658.base.message.itf.IManagerService;

public class MessageManagerClient {

	public static void main(String[] args) throws IOException {
		
		ApplicationConfig ac = new ApplicationConfig();
		ac.setName("category-service-consumer");
		
//		RegistryConfig rc = new RegistryConfig();
//		rc.setAddress("www.wzitech.com");
//		rc.setProtocol("zookeeper");
//		rc.setPort(2181);
		
		MonitorConfig mc = new MonitorConfig();
		mc.setAddress("192.168.130.203:7070");
		mc.setProtocol("dubbo");
		
		ReferenceConfig<IManagerService> rfc = new ReferenceConfig<IManagerService>();
//		rfc.setRegistry(rc);
		rfc.setInterface(IManagerService.class);
		rfc.setApplication(ac);
		rfc.setProtocol("dubbo");
		rfc.setMonitor(mc);
		rfc.setUrl("dubbo://192.168.130.203:20880/com.kb5173.category.itf.ICategoryService");
		
		IManagerService userManager = rfc.get();
		//ItfUserResponseResult result = userManager.getToken("U20151103000001", "ztjie", "http://www.baidu.com");
//		categoryService.gameInfoByGameId("id");
		//String token = result.getToken();
		//System.out.println(token);
	}

}
